<?php

namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    use Notifiable;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password','role_id'
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];

    /**
     * Get the route key for the model. Default key is id
     *
     * @return string
     */
    public function getRouteKeyName()
    {
        return 'id';
    }
     /**
     * Get the role for the user.
     */
    public function role()
    {
        return $this->belongsTo('App\RBAC\Role');
    }


    public function categories()
    {
        return $this->hasMany('App\RBAC\Category');
    }

}
